#pragma once
#include "WareTypes.h"
#include "IWndHandler.h"
#include "WareEngineNameSpace.h"

BEGIN_WARE
class IWareDevice;
class IGraphic;
class ITexture;
class IAudio;
class ISceneManager;
class IResourceManager;
END_WARE

//class CGameScene;

using namespace Ware;

class CBaseApp : public IWndHandler
{
public:
	CBaseApp(void);
	~CBaseApp(void);

	void				Init( int32 nWindowWidth, int32 nWindowHeight, VBOOL bFullScreen = VFALSE, 
								VCHAR* szWindowTitle = NULL, uint32 uWindow = 0, uint32 uIcon = 0,
								VBOOL bMaximized = VTRUE, VBOOL bVsync = VFALSE, VBOOL bAntiAlias = VFALSE );
	void				Run();
	void				Release();

	
	virtual VBOOL		CreateScene();
	virtual VBOOL		UpdateScene( uint32 uCurTime );
	virtual void		ReleaseScene();

	//////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////
	/// wnd Handler
	virtual void		OnResize( int32 nWidth, int32 nHeight );
	virtual void		OnWndSizing( int32 nSide, void* pRect );
	virtual void		OnActive( VBOOL bActive );

private:

	VBOOL				Update();
	void				ReleaseEngineModule();

protected:

	VBOOL				m_bExternalWindow;
	VBOOL				m_bActive;

	//uint32				m_uCurrentSceneID;

	IWareDevice*		m_pDevice;
	IGraphic*			m_pGraphic;

	IAudio*				m_pAudio;
	ISceneManager*		m_pSceneManager;
	IResourceManager*	m_pResourceManager;

};
